//
//  TransferOutTopView.m
//  Wallet
//
//  Created by  ztryxh on 2018/6/12.
//  Copyright © 2018年 ebo. All rights reserved.
//

#import "TransferOutTopView.h"
@interface TransferOutTopView()
{
    UIView *line;
}
@property (nonatomic,strong) UILabel *leftLabel;
@property (nonatomic,strong) UILabel *rightLabel;
@property (nonatomic,strong) UIView  *backView;
@end
@implementation TransferOutTopView
#pragma mark Privacy
-(instancetype)init{
    
    if(self==[super init]){
        
//        [self setBackgroundColor:kSetColor(@"1e2235")];
        [self addSubview:self.backView];
        [self.backView addSubview:self.leftLabel];
        [self.backView addSubview:self.rightLabel];
        line = [[UIView alloc]init];
        line.backgroundColor =rgb(213,213,213);
        [self addSubview:line];
        [self.leftLabel setText:[@"--" stringByAppendingString:@"可用余额"]];
//        [self.rightLabel setText:self.money];

    }
    return self;
}
-(void)layoutSubviews{
    
    [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.right.equalTo(self);
        make.top.mas_equalTo(self.mas_top).offset(1);
        make.bottom.mas_equalTo(self.mas_bottom).offset(-kSCALE_WIDTH(4));
    }];
    
    [self.leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(kSCALE_WIDTH(12));
        make.centerY.equalTo(self);
    }];
    [self.rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-kSCALE_WIDTH(12));
        make.centerY.equalTo(self);
    }];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(12);
        make.right.equalTo(self).offset(-12);
        make.height.mas_equalTo(1);
        make.bottom.equalTo(self);
    }];
    
}
-(void)setModel:(TransferOutInfoModel *)model{
    [self.leftLabel setText:[NSString stringWithFormat:@"%@可用余额",model.type]];
    [self.rightLabel setText:[NSString stringWithFormat:@"%@ %@",model.num,model.type]];
}
-(UILabel *)privacy_createLabel
{
    UILabel *label=[[UILabel alloc]init];
    [label setTextColor:[UIColor blackColor]];
    [label setFont:FONT(14)];
    return label;
}
#pragma mark -lazy
-(UILabel *)leftLabel{
    
    if(!_leftLabel){
        
        _leftLabel=[self privacy_createLabel];
    }
    return _leftLabel;
}
-(UILabel *)rightLabel{
    
    if(!_rightLabel){
        
        _rightLabel=[self privacy_createLabel];
    }
    return _rightLabel;
}
-(UIView *)backView{
    if(!_backView){
        
        _backView=[[UIView alloc]init];
//        [_backView setBackgroundColor:kBackColor];
        
    }
    return _backView;
}
@end
